<template>
	<view>
		<u-navbar back-text="返回" title="查找结果"></u-navbar>
		<view style="padding: 20rpx;">
			<view v-for="(item,index) in list" :key="index" style="padding: 20rpx; background-color: #FFFFFF; margin-bottom: 18rpx; border-radius: 10rpx;">
				<view style="display: flex; align-items: center;">
					<view style="flex: 1; font-weight: 600;">
						<view>{{item.breedName}} - {{item.cateName}}</view>
						<view>{{item.nowAvgPrice}}元/{{item.unit}}</view>
					</view>
					<view style="color: #c0c4cc;">{{item.marketDate}}</view>
				</view>
				<view>
					
				</view>
			</view>
			<view style="padding-top: 200rpx;" v-if="emptyShow">
				<u-empty text="查找不到任何信息" mode="list" show="emptyShow"></u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{},
				list:[],
				emptyShow:false,
			}
		},
		onLoad(option){
			console.log(option);
			this.form.area = option.area;
			this.form.cate = option.cate;
			this.loadList();
		},
		methods: {
			loadList(){
				var that = this;
				uni.request({
					url: this.$unishow + 'api/hangqing/search',
					method: 'GET',
					data: this.form,
					success: res => {
						if(res.data.code == 0){
							that.emptyShow = true;
						}else{
							that.emptyShow = false;
							that.list = res.data;
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
		}
	}
</script>

<style>
	page{
		background-color: #f3f4f6;
	}
</style>
